package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.TogetherTrip;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.TogetherTripQueryObject;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TogetherTripMapper {
    int deleteByPrimaryKey(Long id);

    int insert(TogetherTrip record);

    TogetherTrip selectByPrimaryKey(Long id);

    List<TogetherTrip> selectAll();

    int updateByPrimaryKey(TogetherTrip record);

    List<TogetherTrip> selectForList(TogetherTripQueryObject qo);

    TogetherTrip selectTogetherByUserId(@Param("togetherId") Long togetherId, @Param("userId") Long userId);

    void insertUserAndTogetherRelation(@Param("togetherId") Long togetherId, @Param("userId") Long userId);

    void deleteTogetherAndUserRelation(@Param("togetherId") Long togetherId, @Param("userId") Long userId);

    List<User> getUsersByTogetherId(Long togetherId);

    void updateApplyNumById(@Param("id") Long id, @Param("applyNum") Integer applyNum);

    TogetherTrip selectCollectionByUserId(@Param("togetherId") Long togetherId, @Param("userId") Long userId);

    void insertUserAndTogetherRelation1(@Param("togetherId") Long togetherId, @Param("userId") Long userId);

    void deleteTogetherAndUserRelation1(@Param("togetherId") Long togetherId, @Param("userId") Long userId);

    void updateCollectionNumById(@Param("id") Long id, @Param("collectionNum") Integer collectionNum);

    List<User> getUsersByTogetherCollectionId(Long togetherId);

    List<TogetherTrip> selectAppTogetherTrips(TogetherTripQueryObject qo);

    List<TogetherTrip> selectColTogetherTrips(TogetherTripQueryObject qo);
}